Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Soft-depends on bluesky-social/atproto#3082
This adds a new sorting mode ("hotness") and makes it a default for people who never updated their Thread Preferences (needs package bump). If you previously explicitly expressed a different preference, your old choice will be respected.
Currently, the default thread setting is "oldest first". This means that whoever comments first effectively owns the space above the fold, and there isn't much incentive to reply later — after a certain cutoff, unless you already have an existing follower base for whom your posts is prioritized, your reply will be seen by very few people.
The "hotness" ranking tries to fix this. It is not ideal (and we'll be tweaking it with time), but the goal is to give a chance to recent comments to get people's eyeballs, especially in larger threads — so that people can like your comment even if you haven't already built a significant following. (Most people who already follow you will see your comment at the top with either ranking because "prioritize follows" is true by default — so this doesn't change whether your followers see your posts.)
With the "hotness" ranking, recent comments (whether you have followers or not) will be seen by more users before being "weighed down" by the passage of time. However, likes will make some comments "bubble up" despite being old. The formula I'm using is inspired by this one in Lemmy though it's worth noting we don't have a concept of downvotes. Since we need a mechanic to slightly weigh recent comparatively unpopular posts down, I've added another term to the exponential decay. Other than that, the formula is pretty similar. In short, it tries to balance showing newer stuff with surfacing some of the well-liked older stuff.
Again, the goal isn't to get this 100% right on the first try. However, we'd like conversations to be more dynamic, even in larger threads, and to give more people a chance to be seen — even if they haven't built a following. The exact heuristic will change over time and will likely incorporate other signals (e.g. whether OP liked the reply, whether OP is mutual, etc) so its name ("hotness") is intentionally fuzzy and non-committal. It's also worth emphasizing that this doesn't change much for smaller conversations because people who follow each other already see each other at the top of any comment sections, regardless of their chosen sorting function.
Test Plan
Verify a user with no explicit past chosen preference gets the "hotness" ranking. (This part depends on bluesky-social/atproto#3082.)
Verify a user with an existing past chosen preference keeps their existing preference.
Verify the hotness ranking prioritizes recent posts (comment out the "is self post" check, post something, and verify your comment appears at the top). Then verify that hotness decays over time — add
+ 24
or+ 48
etc to thehoursAgo
variable and verify that your post (with no likes) starts moving downwards (simulating time passing). Then hardcode somelikeCount
for your test post and verify that likes let it "bubble up" somewhat.